package com.lins.store.entity;

import lombok.Data;

import java.io.Serializable;

@Data
//@EqualsAndHashCode(callSuper=false)
public class FileEntity extends BaseEntity implements Serializable {

    /**
	 * 默认序列化版本号
	 */
	private static final long serialVersionUID = 1L;
	private String fileName;
    private String fileSize;
    private String createTime;
    private String share;
    private String uid;
    private String url;
    private String fid;
    private String fileType;
    private String parUrl;
    private String parId;
    private String imgUrl;

    public FileEntity() {
    }

	public FileEntity(String fileName, String uid, String url) {
		this.fileName = fileName;
		this.uid = uid;
		this.url = url;
	}

	public FileEntity(String fileName, String fileSize, String createTime, String share, String fileType, String parUrl, String url, String parId, String imgUrl) {
        this.fileName = fileName;
        this.fileSize = fileSize;
        this.createTime = createTime;
		this.share = share;
        this.fileType = fileType;
        this.parUrl = parUrl;
        this.url = url;
        this.parId = parId;
        this.imgUrl = imgUrl;
    }

    public FileEntity(String fileName, String fileSize, String createTime, String share, String uid, String url, String fileType, String parUrl) {
        this.fileName = fileName;
        this.fileSize = fileSize;
        this.createTime = createTime;
        this.share = share;
        this.uid = uid;
        this.url = url;
        this.fileType = fileType;
        this.parUrl = parUrl;
    }

    public String getFileName() {
        return fileName;
    }

    //方便与链式写法，调用方法后还返回this对象
    public FileEntity setFileName(String fileName) {
        this.fileName = fileName;
        return this;
    }

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		FileEntity other = (FileEntity) obj;
		if (createTime == null) {
			if (other.createTime != null)
				return false;
		} else if (!createTime.equals(other.createTime))
			return false;
		if (fid == null) {
			if (other.fid != null)
				return false;
		} else if (!fid.equals(other.fid))
			return false;
		if (fileName == null) {
			if (other.fileName != null)
				return false;
		} else if (!fileName.equals(other.fileName))
			return false;
		if (fileSize == null) {
			if (other.fileSize != null)
				return false;
		} else if (!fileSize.equals(other.fileSize))
			return false;
		if (fileType == null) {
			if (other.fileType != null)
				return false;
		} else if (!fileType.equals(other.fileType))
			return false;
		if (imgUrl == null) {
			if (other.imgUrl != null)
				return false;
		} else if (!imgUrl.equals(other.imgUrl))
			return false;
		if (parId == null) {
			if (other.parId != null)
				return false;
		} else if (!parId.equals(other.parId))
			return false;
		if (parUrl == null) {
			if (other.parUrl != null)
				return false;
		} else if (!parUrl.equals(other.parUrl))
			return false;
		if (share == null) {
			if (other.share != null)
				return false;
		} else if (!share.equals(other.share))
			return false;
		if (uid == null) {
			if (other.uid != null)
				return false;
		} else if (!uid.equals(other.uid))
			return false;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((createTime == null) ? 0 : createTime.hashCode());
		result = prime * result + ((fid == null) ? 0 : fid.hashCode());
		result = prime * result + ((fileName == null) ? 0 : fileName.hashCode());
		result = prime * result + ((fileSize == null) ? 0 : fileSize.hashCode());
		result = prime * result + ((fileType == null) ? 0 : fileType.hashCode());
		result = prime * result + ((imgUrl == null) ? 0 : imgUrl.hashCode());
		result = prime * result + ((parId == null) ? 0 : parId.hashCode());
		result = prime * result + ((parUrl == null) ? 0 : parUrl.hashCode());
		result = prime * result + ((share == null) ? 0 : share.hashCode());
		result = prime * result + ((uid == null) ? 0 : uid.hashCode());
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		return result;
	}

}
